/*Author Dave LenzCreation date: 15 apr 2009 */package ypmits.data.basic {	public class DataContainer {		private static var _instance : DataContainer;		private var data : Array = [];		
				public function dataLength() : int {			return data.length;		}		public function DataContainer( enforcer : SingletonEnforcer ) {			if (!enforcer) trace( "Class must be instantiated using the getInstance method" );
		}				public static function get instance() : DataContainer {			if( _instance == null ) {				_instance = new DataContainer( new SingletonEnforcer( ) );			}			return _instance;		}				public function addItem( d : DataLoaderItem ) : void {			if( d.data && d.input.id ) {				for (var i : int = 0; i < data.length ; i++) {					if( DataLoaderItem( data[i] ).input.id == d.input.id ) {						throw new Error( "ERROR! id:" + d[1] + " already exists! Choose another id!" );						return;					}				}				data.push( d );			} else {				throw new Error( "ERROR! the array 'd' should at least contain 1 DataLoaderVO" );			}		}				public function getById( id : String ) : DataLoaderItem {			for (var i : int = 0; i < data.length ; i++) {				if( DataLoaderItem( data[i] ).input.id == id) {					return DataLoaderItem( data[i] );				}			}			return null;		}	}}class SingletonEnforcer {}